package com.base.vistter.iframe.security.handler;

import com.base.vistter.iframe.menu.ErrorLoginEnum;
import com.base.vistter.iframe.utils.IoUtils;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;

import java.io.IOException;

/**
 * 权限不足
 */
public class IframeAccessDeniedHandler implements AccessDeniedHandler {
    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException{
        IoUtils.errorWrite(ErrorLoginEnum.USER_LOGIN_TIMEOUT, response);

    }
}
